
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
      <?php
header("Content-type: text/html; charset=utf-8");

require("conn.php");
$action=@$_GET['action'];
?> 
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>公告添加</title>
  <!--[if lt IE 9]>
  <script type="text/javascript" src="static/js/html5.js"></script>
  <script type="text/javascript" src="static/js/respond.min.js"></script>
  <![endif]-->
  <script type="text/javascript" src="static/js/jquery.min.js"></script>
  <script type="text/javascript" src="static/js/laypage.js"></script>
  <script type="text/javascript" src="static/js/layer.js"></script>
  <link rel="stylesheet" type="text/css" href="static/css/iconfont.css">
  <link href="static/css/Style.css" rel="stylesheet" type="text/css">    

  
</head>
<body>
    <div class="m_path">
        <div class="m_ptxt1">
            <div class="m_nav2" onClick="location.href='admin_manage.php';"><i class="iconfont">&#xe6a4;</i>&ensp;公告添加</div>
            
        
        </div>
        <div class="m_ptxt2"><i class="iconfont">&#xe6b8;</i>&ensp;位置：<a  href="index.php" target="_top">首页</a> > 公告添加</div>
    </div>
  <?php

  if($action=="addsave"){
  $title=@$_POST['title'];
  $content=@$_POST['content'];
$time = time();


  if($title==""){
   echo "<script language='javascript'>alert('主题不能为空！');history.go(-1)</script>";
   return false;
  }
     if($content==""){
   echo "<script language='javascript'>alert('公告内容不能为空！');history.go(-1)</script>";
   return false;
  }

  
  $sql1="INSERT INTO notice(title,nei,tai) VALUES ('".$title."','".$content."',".$time.");";

  
    if (mysql_query($sql1)){ 
  
    echo "<script language='javascript'>alert('添加成功！');window.location.href='qiye.php?lei=qq&a=reg';</script>";
    return false;
   }else{
   echo 'no';
   }
  }
 
  ?>
   
   <div class="m_rctr">
        <div class="m_ssctt">
            <form id="myform"  name="myform" action="?action=addsave" method="post">
    
                <table width="100%" cellpadding="0" cellspacing="0">
                    <tbody>
                      <tr>
                        <td width="110" class="t-ar">主题：</td>
                        <td>
                            <input type="text" name="title" id="title" datatype="*" nullmsg="请输入主题!" class="input_txt" value="">
                            
                        </td>
                    </tr>
                   
                   
                     <tr>
                        <td width="110" class="t-ar">内容：</td>
                        <td>
                              <textarea id="content" width="400" height="200" style="width: 400px; height: 200px;" name="content"></textarea>
                           
                        </td>
                    </tr>
           
                 
                    <tr>
                        <td height="55" style="border:0;">&nbsp;</td>
                        <td style="border:0;">
                            <input type="submit" class="input_btn" value="确认添加" onMouseOver="this.className='input_btn1'" onMouseOut="this.className='input_btn'">
                            <input type="reset" class="input_btn" value="取消重置" onMouseOver="this.className='input_btn1'" onMouseOut="this.className='input_btn'">
                        </td>
                    </tr>
                </tbody></table>
            </form>
        </div>
    </div>
  

 
</body>
</html>

<script language="javascript" charset="utf-8">
function init(i) {
  var windowWidth, windowHeight;
  windowWidth=$(window).width();
  windowHeight=$(window).height();
  if(i==1){
    $("#k_btn1").hide();
    $("#k_btn2").show();
    $("#k_left").hide();
    $("#k_right").width(windowWidth-3);
  }
  else if(i==2){
    $("#k_btn2").hide();
    $("#k_btn1").show();
    $("#k_left").show();
    $("#k_right").width(windowWidth-193);
  }
  else {
    $("#k_left").height(windowHeight-158);
    $("#f_left").height(windowHeight-158);
    $("#k_btn1").css("top",(windowHeight-158-58)/2+"px");
    $("#k_btn2").css("top",(windowHeight-158-58)/2+"px");
    $("#k_right").width(windowWidth-193);
    $("#k_right").height(windowHeight-158);
    iFrame = $("#main");
    iFrame.height(windowHeight-158);
  }
}
$(document).ready(function() {
    init(0);
    window.onresize = function() {
        init(0);
    }
});
</script>